<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.sql.ResultSet" import="domain.AllProperty" import="domain.PropertyScrap"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<jsp:useBean id="allProperty" class="repository.AllPropertyDAO"></jsp:useBean>
<jsp:useBean id="allProp" class="repository.PropertyScrapDAO"></jsp:useBean>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<%
	ResultSet rs = allProperty.query(request.getParameter("ID"));
	AllProperty all = new AllProperty();
	while(rs.next()){
		all.setID(rs.getString("物品ID"));
		all.setName(rs.getString("物品名称"));
		all.setPrice(rs.getString("物品价格"));
		all.setLocation(rs.getString("所属学院"));
		all.setUse(rs.getString("使用状况"));
		all.setNumber(rs.getString("数量"));
	}
	PropertyScrap prosc = new PropertyScrap();
	prosc.setID(all.getID());
	prosc.setName(all.getName());
	prosc.setLocation(all.getLocation());
	prosc.setNumber(all.getNumber());
	
	allProp.insert(prosc);
	allProperty.delete(request.getParameter("ID"));
	response.sendRedirect("AllPropertyDate.jsp");
%>
</body>
</html>